import request from '@/utils/request'

// 店铺信息
export function getShopDetail(userId) {
  
  return request({
    'url': `/shop/getShopByUserId/${userId}`,
    'method': 'get',
  })
}

export function getShopProducts(shopId, sortIndex = 0, priceMin = null, priceMax = null) {
    return request({
        url: `/shop/getShopProducts/${shopId}`,
        method: 'get',
        params: {
            sortIndex,  
            priceMin,    // 最低价格
            priceMax     // 最高价格
        }
    });
}
export function createShop(data) {
  
  return request({
    'url': `/shop/create`,
    'method': 'post',
	data
  })
}
export function updateShop(data) {
  
  return request({
    'url': `/shop/update`,
    'method': 'post',
	data
  })
}